﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace IRProject.Model
{
    public static class ResultListExtensions
    {
        public static bool contain(this List<ResultData> list, int id)
        {
            bool c = false;
            foreach (ResultData r in list)
            {
                if (r.DocId == id)
                    c = true;
            }
            return c;
        }

        public static ResultData getById(this List<ResultData> list, int id)
        {
            foreach (ResultData r in list)
                if (r.DocId == id)
                    return r;
            return null;
        }

    }
}
